.class public Lcom/zuiapps/suite/utils/ui/ResUtil;
.super Ljava/lang/Object;
.source "ResUtil.java"


# static fields
.field private static ru:Lcom/zuiapps/suite/utils/ui/ResUtil;


# instance fields
.field private pkg:Ljava/lang/String;

.field private resources:Landroid/content/res/Resources;


# direct methods
.method private constructor <init>(Landroid/content/Context;)V
    .registers 3
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 11
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 12
    invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    .line 13
    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    iput-object v0, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    .line 14
    return-void
.end method

.method public static getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/ui/ResUtil;
    .registers 2
    .param p0, "context"    # Landroid/content/Context;

    .prologue
    .line 17
    sget-object v0, Lcom/zuiapps/suite/utils/ui/ResUtil;->ru:Lcom/zuiapps/suite/utils/ui/ResUtil;

    if-nez v0, :cond_b

    .line 18
    new-instance v0, Lcom/zuiapps/suite/utils/ui/ResUtil;

    invoke-direct {v0, p0}, Lcom/zuiapps/suite/utils/ui/ResUtil;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/zuiapps/suite/utils/ui/ResUtil;->ru:Lcom/zuiapps/suite/utils/ui/ResUtil;

    .line 19
    :cond_b
    sget-object v0, Lcom/zuiapps/suite/utils/ui/ResUtil;->ru:Lcom/zuiapps/suite/utils/ui/ResUtil;

    return-object v0
.end method


# virtual methods
.method public animId(Ljava/lang/String;)I
    .registers 7
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 104
    :try_start_0
    iget-object v2, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    const-string v3, "anim"

    iget-object v4, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    invoke-virtual {v2, p1, v3, v4}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_9} :catch_b

    move-result v1

    .line 109
    :goto_a
    return v1

    .line 106
    :catch_b
    move-exception v0

    .line 107
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 109
    const/4 v1, 0x0

    goto :goto_a
.end method

.method public arrayId(Ljava/lang/String;)I
    .registers 7
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 114
    :try_start_0
    iget-object v2, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    const-string v3, "array"

    iget-object v4, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    invoke-virtual {v2, p1, v3, v4}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_9} :catch_b

    move-result v1

    .line 119
    :goto_a
    return v1

    .line 116
    :catch_b
    move-exception v0

    .line 117
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 119
    const/4 v1, 0x0

    goto :goto_a
.end method

.method public colorId(Ljava/lang/String;)I
    .registers 7
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 54
    :try_start_0
    iget-object v2, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    const-string v3, "color"

    iget-object v4, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    invoke-virtual {v2, p1, v3, v4}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_9} :catch_b

    move-result v1

    .line 59
    :goto_a
    return v1

    .line 56
    :catch_b
    move-exception v0

    .line 57
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 59
    const/4 v1, 0x0

    goto :goto_a
.end method

.method public dimenId(Ljava/lang/String;)I
    .registers 7
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 64
    :try_start_0
    iget-object v2, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    const-string v3, "dimen"

    iget-object v4, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    invoke-virtual {v2, p1, v3, v4}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_9} :catch_b

    move-result v1

    .line 69
    :goto_a
    return v1

    .line 66
    :catch_b
    move-exception v0

    .line 67
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 69
    const/4 v1, 0x0

    goto :goto_a
.end method

.method public drawableId(Ljava/lang/String;)I
    .registers 7
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 124
    :try_start_0
    iget-object v2, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    const-string v3, "drawable"

    iget-object v4, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    invoke-virtual {v2, p1, v3, v4}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_9} :catch_b

    move-result v1

    .line 129
    :goto_a
    return v1

    .line 126
    :catch_b
    move-exception v0

    .line 127
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 129
    const/4 v1, 0x0

    goto :goto_a
.end method

.method public layoutId(Ljava/lang/String;)I
    .registers 7
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 84
    :try_start_0
    iget-object v2, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    const-string v3, "layout"

    iget-object v4, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    invoke-virtual {v2, p1, v3, v4}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_9} :catch_b

    move-result v1

    .line 89
    :goto_a
    return v1

    .line 86
    :catch_b
    move-exception v0

    .line 87
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 89
    const/4 v1, 0x0

    goto :goto_a
.end method

.method public menuId(Ljava/lang/String;)I
    .registers 7
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 44
    :try_start_0
    iget-object v2, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    const-string v3, "menu"

    iget-object v4, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    invoke-virtual {v2, p1, v3, v4}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_9} :catch_b

    move-result v1

    .line 49
    :goto_a
    return v1

    .line 46
    :catch_b
    move-exception v0

    .line 47
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 49
    const/4 v1, 0x0

    goto :goto_a
.end method

.method public rawId(Ljava/lang/String;)I
    .registers 7
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 134
    :try_start_0
    iget-object v2, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    const-string v3, "raw"

    iget-object v4, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    invoke-virtual {v2, p1, v3, v4}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_9} :catch_b

    move-result v1

    .line 139
    :goto_a
    return v1

    .line 136
    :catch_b
    move-exception v0

    .line 137
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 139
    const/4 v1, 0x0

    goto :goto_a
.end method

.method protected resourcesId(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)I
    .registers 8
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "type"    # Ljava/lang/String;
    .param p3, "name"    # Ljava/lang/String;

    .prologue
    .line 24
    :try_start_0
    iget-object v2, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    iget-object v3, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    invoke-virtual {v2, p3, p2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    :try_end_7
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_7} :catch_9

    move-result v1

    .line 29
    :goto_8
    return v1

    .line 26
    :catch_9
    move-exception v0

    .line 27
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 29
    const/4 v1, 0x0

    goto :goto_8
.end method

.method public stringId(Ljava/lang/String;)I
    .registers 7
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 34
    :try_start_0
    iget-object v2, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    const-string v3, "string"

    iget-object v4, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    invoke-virtual {v2, p1, v3, v4}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_9} :catch_b

    move-result v1

    .line 39
    :goto_a
    return v1

    .line 36
    :catch_b
    move-exception v0

    .line 37
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 39
    const/4 v1, 0x0

    goto :goto_a
.end method

.method public styleId(Ljava/lang/String;)I
    .registers 7
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 74
    :try_start_0
    iget-object v2, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    const-string v3, "style"

    iget-object v4, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    invoke-virtual {v2, p1, v3, v4}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_9} :catch_b

    move-result v1

    .line 79
    :goto_a
    return v1

    .line 76
    :catch_b
    move-exception v0

    .line 77
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 79
    const/4 v1, 0x0

    goto :goto_a
.end method

.method public viewId(Ljava/lang/String;)I
    .registers 7
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 94
    :try_start_0
    iget-object v2, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->resources:Landroid/content/res/Resources;

    const-string v3, "id"

    iget-object v4, p0, Lcom/zuiapps/suite/utils/ui/ResUtil;->pkg:Ljava/lang/String;

    invoke-virtual {v2, p1, v3, v4}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_9} :catch_b

    move-result v1

    .line 99
    :goto_a
    return v1

    .line 96
    :catch_b
    move-exception v0

    .line 97
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 99
    const/4 v1, 0x0

    goto :goto_a
.end method
